Skip to content

Assorted bootstrap LLVM refactors (part 3/N) - #161247

Open
Kobzol wants to merge 6 commits into
rust-lang:mainfrom
Kobzol:bootstrap-llvm-3
Open

Assorted bootstrap LLVM refactors (part 3/N)#161247
Kobzol wants to merge 6 commits into
rust-lang:mainfrom
Kobzol:bootstrap-llvm-3

Conversation

@Kobzol

@Kobzol Kobzol commented Aug 17, 2026

Copy link
Copy Markdown
Member

View all comments

Continuation of #160916.

This PR removes the llvm_out function, and makes it explicit when we need to build the host LLVM.

Before, bootstrap used to just arbitrarily run a llvm-config binary, even though it might not have been executable on the given host. Now, if we need to execute it, the host LLVM will always be explicitly built. It is possible that there are some cases where this will build LLVM where it didn't before, but that should only happen if you were on a target A, built LLVM for target B, and by sheer luck A could execute code for B (where A != B).
In any case, it is now explicit, so if we encounter such situation, we can fix it without depending on implicit assumptions (well, there are still thousands of other assumptions, but you get my point).

After this, I'll work on centralizing the sanity checking of downloading LLVM inside the LlvmFromCi step, which will allow us to log the exact reason why download-ci-llvm might not have been applied, and also enable downloading LLVM from CI for non-host targets.

r? jieyouxu

@rustbot

rustbot commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp.

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Aug 17, 2026
@rustbot

rustbot commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

jieyouxu is currently at their maximum review capacity.
They may take a while to respond.

Comment thread src/bootstrap/src/core/builder/mod.rs Outdated
@rust-log-analyzer

This comment has been minimized.

@jieyouxu jieyouxu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT this generally looks good. One question on the test change.

View changes since this review

Comment thread src/bootstrap/src/core/builder/tests.rs Outdated
Comment thread src/bootstrap/src/core/build_steps/compile.rs

@jieyouxu jieyouxu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, r=me after pr ci green
@bors rollup=never note="bootstrap llvm rework just in case"

View changes since this review

@Kobzol

Kobzol commented Aug 18, 2026

Copy link
Copy Markdown
Member Author

@bors r=jieyouxu

@rust-bors

rust-bors Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 781ef03 has been approved by jieyouxu

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 18, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors p=6 scheduling

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 19, 2026
Assorted bootstrap LLVM refactors (part 3/N)

Continuation of #160916.

This PR removes the `llvm_out` function, and makes it explicit when we need to build the host LLVM.

Before, bootstrap used to just arbitrarily run a `llvm-config` binary, even though it might not have been executable on the given host. Now, if we need to execute it, the host LLVM will always be explicitly built. It is possible that there are some cases where this will build LLVM where it didn't before, but that should only happen if you were on a target A, built LLVM for target B, and by sheer luck A could execute code for B (where A != B).
In any case, it is now explicit, so if we encounter such situation, we can fix it without depending on implicit assumptions (well, there are still thousands of other assumptions, but you get my point).

After this, I'll work on centralizing the sanity checking of downloading LLVM inside the `LlvmFromCi` step, which will allow us to log the exact reason why `download-ci-llvm` might not have been applied, and also enable downloading LLVM from CI for non-host targets.

r? jieyouxu
@rust-log-analyzer

This comment has been minimized.

@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 19, 2026
@rust-bors

rust-bors Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 55e7b47 failed: CI. Failed job:

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 20, 2026
@Kobzol

Kobzol commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

@bors try jobs=dist-aarch64-freebsd

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 20, 2026
Assorted bootstrap LLVM refactors (part 3/N)


try-job: dist-aarch64-freebsd
@rust-log-analyzer

This comment has been minimized.

@rustbot

rustbot commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@Kobzol

Kobzol commented Aug 24, 2026

Copy link
Copy Markdown
Member Author

Rebased.

@bors r=jieyouxu

@bors try jobs=dist-aarch64-freebsd

@rust-bors

rust-bors Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

📌 Commit c6d2681 has been approved by jieyouxu

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 24, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 24, 2026
Assorted bootstrap LLVM refactors (part 3/N)


try-job: dist-aarch64-freebsd
@rust-log-analyzer

This comment has been minimized.

@rust-bors rust-bors Bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 24, 2026
@rust-bors

rust-bors Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

💔 Test for ad9d7cd failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@Kobzol

Kobzol commented Aug 24, 2026

Copy link
Copy Markdown
Member Author

@bors r-

@rust-bors rust-bors Bot removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Aug 24, 2026
@rust-bors

rust-bors Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

View changes since this unapproval

@Kobzol

Kobzol commented Aug 24, 2026

Copy link
Copy Markdown
Member Author

@bors try jobs=dist-aarch64-freebsd

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 24, 2026
Assorted bootstrap LLVM refactors (part 3/N)


try-job: dist-aarch64-freebsd
@rust-bors

rust-bors Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: cb0b8f1 (cb0b8f1324f425f453c52fbb5176c2b0bcde7103)
Base parent: 04a3cad (04a3cad16c522be4fd15ca76d3c119c14be68954)

@Kobzol

Kobzol commented Aug 24, 2026

Copy link
Copy Markdown
Member Author

@bors r=jieyouxu

@rust-bors

rust-bors Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 730b9d8 has been approved by jieyouxu

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 24, 2026
@rust-bors

rust-bors Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

⌛ Testing commit 730b9d8 with merge ac62df9...

Workflow: https://github.com/rust-lang/rust/actions/runs/32717790533

rust-bors Bot pushed a commit that referenced this pull request Aug 24, 2026
Assorted bootstrap LLVM refactors (part 3/N)



Continuation of #160916.

This PR removes the `llvm_out` function, and makes it explicit when we need to build the host LLVM.

Before, bootstrap used to just arbitrarily run a `llvm-config` binary, even though it might not have been executable on the given host. Now, if we need to execute it, the host LLVM will always be explicitly built. It is possible that there are some cases where this will build LLVM where it didn't before, but that should only happen if you were on a target A, built LLVM for target B, and by sheer luck A could execute code for B (where A != B).
In any case, it is now explicit, so if we encounter such situation, we can fix it without depending on implicit assumptions (well, there are still thousands of other assumptions, but you get my point).

After this, I'll work on centralizing the sanity checking of downloading LLVM inside the `LlvmFromCi` step, which will allow us to log the exact reason why `download-ci-llvm` might not have been applied, and also enable downloading LLVM from CI for non-host targets.

r? jieyouxu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants